import fetch from 'common/fetch'
import {warning} from 'common/uri'

export function addWaringRule(params) {
  return fetch({
    url: warning.rule,
    method: 'post',
    data: params
  })
}

export function getWaringRuleById(params) {
  return fetch({
    url: warning.rule,
    method: 'get',
    params
  })
}

export function getWarningPageData(params) {
  return fetch({
    url: warning.rules,
    method: 'get',
    params
  })
}

export function deleteWaringRuleById(params) {
  return fetch({
    url: warning.rule,
    method: 'delete',
    params
  })
}

export function runWaring(params) {
  return fetch({
    url: warning.runRule,
    method: 'post',
    data: params
  })
}
